package com.brkj.course;

import java.util.List;

import net.tsz.afinal.FinalDb;
import net.tsz.afinal.annotation.view.ViewInject;
import android.os.Bundle;
import android.widget.ListView;

import com.brkj.model.DS_Course;
import com.brkj.main.R;
import com.brkj.util.ConstAnts;
import com.brkj.util.view.BaseActivity;

public class StudyHistoryActivity extends BaseActivity{
	
	@ViewInject(id=R.id.courseListView) ListView courseListView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		setAnimType(BaseActivity.RIGHT_ENTER_LEFT_EXT);
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.course_study_history);
		setActivityTitle("浏览历史");
		setReturnBtn();
		
		getHistoryCourse();
	}

	private void getHistoryCourse() {
		FinalDb db = FinalDb.create(this, ConstAnts.BRKJ_DB);
		
		List<DS_Course> courseList = db.findAll(DS_Course.class,"studyTime");
		
		CourseAdapter adapter = new CourseAdapter(this, courseList);
		
		courseListView.setAdapter(adapter);
	}

	
	
}
